using System;

using Microsoft.Xna.Framework.Graphics;

namespace Storyteller.Framework.Graphics
{
	public class RenderTexture : Texture
	{
		public RenderTexture(int width, int height)
			: base()
		{
			texture2d = new RenderTarget2D(Game.Instance.GraphicsDevice, width, height);

			handleDisposing = true;
		}
		
		public void Bind()
		{
			Game.Instance.GraphicsDevice.SetRenderTarget(texture2d as RenderTarget2D);
		}
		
		public void Unbind()
		{
			Game.Instance.GraphicsDevice.SetRenderTarget(null);
		}
	}
}
